#include <cstdio>

int gcd( int a, int b )
{
    int rem;
    while ( b )
    {
        rem = a % b;
        a = b;
        b = rem;
    }
    return a;
}

int main( )
{
    int n, m;
    while ( scanf("%d%d", &n, &m) )
    {
        if ( n == -1 && m == -1 )
            break;
        if ( gcd( n, m ) == 1 )
            puts("YES");
        else
            puts("POOR Haha");
    }
    return 0;
}
